Skip to main content

how to run loe-coe

Instructions to Run the Pipe-Breaks App

Flow 1: Running the Streamlit UI (app.py)

  1. Load the Python Environment: Ensure you are in the correct Python environment:

    workon pipe-break38
  2. Run the Streamlit App: Execute the app.py file to start the Streamlit UI:

    streamlit run app.py
  3. Use the Streamlit Interface:

    • Open your web browser and navigate to the local server address provided by Streamlit (usually http://localhost:8501).
    • Use the sidebar to select algorithms and utilities, create shell scripts, find buildings affected by water main breaks, and view results.

Flow 2: Running Scripts with script_runner.py

Note : additional info on script_runner.py mermaid

  1. Load the Python Environment: Ensure you are in the correct Python environment:

    workon pipe-break38
  2. Run script_runner.py with Debugger: To run the script with a debugger, use your preferred IDE. Below are instructions for setting up debugging in VSCode.

How to Debug the Pipe-Breaks App in VSCode

  1. Create a launch.json for Python file:

    In your VSCode workspace, create or update the .vscode/launch.json file with the following configuration:

    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
    {
    "name": "Python: Current File",
    "type": "python",
    "request": "launch",
    "program": "script_runner.py",
    "cwd": "${workspaceFolder}",
    "console": "integratedTerminal",
    "args": ["-s", "cox_ph", "-u", "dnv"],
    "justMyCode": true
    }
    ]
    }
  2. Explanation of launch.json Configuration:

    • program: Should contain the entry point of your package which calls all the other files.
    • cwd: Sets the Current Working Directory to the workspaceFolder.
    • args: Any additional arguments that need to be passed to the script (e.g., -s xgbse_gqc -u dnv).
  3. Run the Debugger:

    • Open the script_runner.py file in VSCode.
    • Press F5 to start debugging using the specified configuration in launch.json.

This setup allows you to run and debug the script_runner.py script with specific arguments, enabling you to switch between different algorithms and utilities as needed.